package mysql

import "gorm.io/gorm"

type OrderGoods struct {
	gorm.Model
	OrderSn    string  `gorm:"type:char(36);not null;comment:订单编号"`
	GoodsId    int     `gorm:"type:int(11);not null;comment:商品ID"`
	GoodsTitle string  `gorm:"type:varchar(30);not null;comment:商品标题"`
	Price      float64 `gorm:"type:decimal(10,2);not null;comment:价格"`
	Num        int64   `gorm:"type:int(11);not null;comment:数量"`
	GoodsImg   string  `gorm:"type:varchar(255);not null;comment:商品图片"`
}

func (oG *OrderGoods) Create() error {
	return Db.Create(&oG).Error
}
